from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://qxk.admin.sauou.com/')
from selenium.webdriver.common.by import By
import pytest
driver.maximize_window()
from time import sleep
driver.implicitly_wait(10)

def test_1():
   driver.find_element(By.XPATH,'//input[@placeholder="请输入您的用户名"]').clear()
   driver.find_element(By.XPATH,'//input[@placeholder="请输入您的用户名"]').send_keys('admin')
   driver.find_element(By.XPATH,'//input[@placeholder="请输入您的密码"]').clear()
   driver.find_element(By.XPATH,'//input[@placeholder="请输入您的密码"]').send_keys('123456')
   driver.find_element(By.XPATH,'//span[text()="登录"]').click()
   sleep(1)
   driver.find_element(By.XPATH,'//span[text()="卡密配置"]').click()
   sleep(1)
   driver.find_element(By.XPATH,'//div[text()="系列管理"]').click()
   sleep(1)
   driver.find_element(By.XPATH,'//input[@placeholder="系列名称"]/../../../..//span[text()="新增"]').click()
   # 点击选择赛季名称
   driver.find_element(By.XPATH,'//label[text()="赛季名称"]/..//input').click()
   # 获取运动下拉列表
def option_text():
   text =driver.find_element(By.XPATH,'//label[text()="赛季名称"]/../../../../../..//div[@class="el-scrollbar"]//ul//span').text
   print(text)
   return text
   # for i in options:
   #    opt = []
   #    opt.append(i)
   #    print(opt)
   #    return options






if __name__ == '__main__' :
   option_text()
   test_1()
   print(option_text())
   # pytest.main(['test_1.py','-s'])  # '--capture=no'
